//
// Created by ZLY on 2025/5/10.
//

#ifndef SPELL_H
#define SPELL_H
#include "../affiliate/sprite_anim.h"
#include "../core/object_world.h"


class Spell : public ObjectWorld {
protected:
    SpriteAnim *sprite_ = nullptr;
    float damage_ = 60.0f;

public:
    static Spell *addSpellChild(Object *parent, const std::string &file_path, glm::vec2 pos, float damage,
                                float scale = 1.0f,
                                Anchor anchor = Anchor::CENTER);

    void update(float dt) override;

    void setSpriteAnim(SpriteAnim *spriteAnim) {
        sprite_ = spriteAnim;
    }

    SpriteAnim *getSpriteAnim() const {
        return sprite_;
    }

    float getDamage() const { return damage_; }
    void setDamage(float damage) { damage_ = damage; }

    void attack();
};


#endif //SPELL_H
